import bb.cascades 1.0

NavigationPane {
    id: addNavigation
    peekEnabled: false
    
    Page {
        actions: [
            // define the actions for first tab here
//            ActionItem {
//                title: qsTr("Rotate")
//                onTriggered: {
//                    //                imgTab1.rotationZ = imgTab1.rotationZ + 90;
//                }
//            },
//            ActionItem {
//                title: qsTr("Break")
//                onTriggered: {
//                    //                imgTab1.imageSource = "asset:///images/picture1br.png";
//                }
//            }
        ]
        
        titleBar: TitleBar {
            id: titleBar
            visibility: ChromeVisibility.Visible
            title: lang.add_title
        }
        
        Container {
            //            Container {
            ////                horizontalAlignment: HorizontalAlignment.Center
            //                Label {
            //                    text: lang.add_title
            //                }
            //            }
            
//            Divider {
//            }
            
            Container {
                topPadding: 50
                horizontalAlignment: HorizontalAlignment.Center
                
                ImageButton {
                    defaultImageSource: "asset:///images/add/expenses.png"
                    
                    onClicked: {
                        // show detail page when the button is clicked
                        var adddetailpage = addNavigation.getAddDetailPage();
                        console.debug("pushing detail " + adddetailpage);
                        adddetailpage.setModeExpenses();
                        addNavigation.push(adddetailpage);
                    }
                }
                Label {
                    horizontalAlignment: HorizontalAlignment.Center
                    text: lang.add_button_expenses
                }
            }
            
            Divider {
                topPadding: 50
//                verticalAlignment: VerticalAlignment.Center
            }
            
            Container {
                topPadding: 50
                horizontalAlignment: HorizontalAlignment.Center
                ImageButton {
                    defaultImageSource: "asset:///images/add/income.png"
                    
                    onClicked: {
                        // show detail page when the button is clicked
                        var adddetailpage = addNavigation.getAddDetailPage();
                        console.debug("pushing detail " + adddetailpage);
                        adddetailpage.setModeIncome();
                        addNavigation.push(adddetailpage);
                    }
                }
                Label {
                    horizontalAlignment: HorizontalAlignment.Center
                    text: lang.add_button_income
                }
            }
            
            //            Button {
            //                text: "next"
            //                horizontalAlignment: HorizontalAlignment.Center
            //                
            //                onClicked: {
            //                    // show detail page when the button is clicked
            //                    var adddetailpage = addNavigation.getAddDetailPage();
            //                    console.debug("pushing detail " + adddetailpage)
            //                    addNavigation.push(adddetailpage);
            //                }
            //            
            //            }
        }
    
    
    }
    
    onPopTransitionEnded: {
        home.updateStatus() ;
    }
    
    attachedObjects: [
        ComponentDefinition {
            id: addDetailDefinition
            source: "AddDetail.qml"
        }
    ]
    property Page addDetailPage
    function getAddDetailPage() {
//        if (! addDetailPage) {
            addDetailPage = addDetailDefinition.createObject();
//        }
        return addDetailPage;
    }
}
